package edu.zhuku.myset;

import java.util.Iterator;
import java.util.TreeSet;


public class MySet {
	
	public static void main(String[] args) {
		Myset1 u1 = new Myset1("小张",45);
		Myset1 u2 = new Myset1("小少",18);
		Myset1 u3 = new Myset1("小明",99);
		
		TreeSet<Myset1>ts = new TreeSet<Myset1>();
		
		ts.add(u1);
		ts.add(u2);
		ts.add(u3);
		
		Iterator itr = ts.iterator();
		while(itr.hasNext())
		{
			Myset1 u = (Myset1)itr.next();
			System.out.println(u.userAge + u.userName);
		}

	}

}
